package com.hsxc.cdz.monitor.bean.pile.v1_21;

import com.hsxc.cdz.base.util.BytesUtil;

/**
 * 
 * @author 刘力文
 * 充电桩主动上送的刷卡报文的实体类
 */
public class CardPileMsg extends PileMessage {
	
	private int chargePort;   //充电端口 0表示A，1表示B
	private String cardNum;   //用户卡号

	public int getChargePort() {
		return chargePort;
	}
	public void setChargePort(int chargePort) {
		this.chargePort = chargePort;
	}

	public String getCardNum() {
		return cardNum;
	}
	public void setCardNum(String cardNum) {
		this.cardNum = cardNum;
	}

	@Override
	public void getContentFromByte(byte[] data) {
		byte[] temp;
        temp = BytesUtil.getByte(0,1,data);
        this.setChargePort(BytesUtil.bytesToIntSeq(temp));
        
        temp = BytesUtil.getByte(1,10,data);
        this.setCardNum(BytesUtil.bcdBytesToStr(temp));
	}
	@Override
	public String toString() {
		return "CardContent [chargePort=" + chargePort +", cardNum=" + cardNum + "]";
	}
	
	
	
}
